package com.pactera.request;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.pactera.constants.UCServiceConstants;
import com.pactera.util.SignUtil;

/**
 * UC接口调用基础类
 *
 * @author panglx
 * @since 2018年03月16日 10:45
 **/
public abstract class UCBaseRequest implements Serializable {

    private static final long serialVersionUID = 4423406609165647088L;

    /**
     * 请求时间戳
     */
    private String timestamp = String.valueOf(System.currentTimeMillis()).substring(0, 10);

    /**
     * 请求摘要
     */
    private String token = SignUtil.sign(timestamp, UCServiceConstants.PRIV_KEY);

    /**
     * 系统ID
     */
    private String sysId = UCServiceConstants.SYS_ID;

    /**
     * 子类继承后返回
     *
     * @return 返回调用接口的URL
     */
    @JsonIgnore
    public abstract String getFunctionUrl();

    /**
     * 子类继承后返回
     *
     * @return 返回调用接口的名称
     */
    @JsonIgnore
    public abstract String getFunctionName();

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getSysId() {
        return sysId;
    }

    public void setSysId(String sysId) {
        this.sysId = sysId;
    }
}
